Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Place all generated files in separate GENERATED list, so they all can… #1404

Merged
merged 1 commit into from
Mar 22, 2020

Conversation

Mikhael-Danilov
Copy link
Contributor

… be cleaned by clean target.

What does this PR do?

All files generated by regular or custom rules for gmake2/cpp projects will be placed in separate GENERATED list, and will be deleted on make clean invocation.

How does this PR change Premake's behavior?

All files generated by custom rules for gmake2/cpp will be deleted on make clean invocation

Are there any breaking changes? Will any existing behavior change?

Probably no. Yes, previously buildoutputs of custom rules gmake2/cpp was persisted after make clean now they will be deleted.

Anything else we should know?

I use tolua for lua-c++ bindings, with this change generated files will be properly cleaned on make clean step.

closes #1380

Did you check all the boxes?

  • [v] Focus on a single fix or feature; remove any unrelated formatting or code changes
  • [v] Add unit tests showing fix or feature works; all tests pass
  • [v] Mention any related issues (put closes #XXXX in comment to auto-close issue when PR is merged)
  • [v] Follow our coding conventions
  • [v] Minimize the number of commits

You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to requests like these!

@starkos
Copy link
Member

starkos commented Mar 16, 2020

Looking at the tests, it would appear that both OBJECTS and GENERATED are always the same. We already delete all of the object files on make clean, so it isn't obvious why this change is needed.

Presumably you intended this code to also handle the output of custom build rules. If so, could you add a test to show that? I'd like to see a case where OBJECTS and GENERATED end up with different contents, otherwise it would be simpler to just use the list that's already there.

@Mikhael-Danilov
Copy link
Contributor Author

Thank you for feedback.

I added customBuildCommand_generatedCpp test to show case I'm trying to handle: custom rule was used to generate C++ source and header files, said files will populate CUSTOM, OBJECTS and SOURCES so GENERATED will be required to keep all their traces.

Copy link
Member

@starkos starkos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the extra test! Approving…

@starkos starkos merged commit 5b2f92c into premake:master Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gmake2: buildoutputs for custom rules not cleaned on make clean
2 participants